<?php
namespace cms\modules\v1\controllers;

use cms\modules\v1\models\Home;
use Yii;
use yii\filters\auth\HttpHeaderAuth;
use yii\helpers\ArrayHelper;

class ApiController extends DefaultController
{
    public $modelClass = '';
    public function behaviors()
    {
        return ArrayHelper::merge(parent::behaviors(), [
            'authenticator' => [
                'class' =>  HttpHeaderAuth::className(),    //head头部验证
                'header' => 'access-token',
                'optional' => [
                
                ]
            ]
        ]);
    }
    public function actionList() {
        if (Yii::$app->request->isGet) {
            return (new Home())->getList();
        }
    }
}
